class CreateAnswers < ActiveRecord::Migration
  def self.up
    create_table :answers do |t|
      t.integer     :person_id, :null => false
      t.integer     :question_id, :null => false
      t.integer     :answer_id, :limit => 1
      t.integer     :correct_answer, :limit => 1
      
      t.timestamps
    end
    
    add_index :answers, [:person_id, :question_id]
  end

  def self.down
    drop_table :answers
  end
end
